// components/common/auditing/auditing.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    result:Object,
  
  },

  /**
   * 组件的初始数据
   */
  data: {
    
  },

  /**
   * 组件的方法列表
   */
  methods: {
    passBtn(e){
      var id = e.currentTarget.dataset.id;
      console.log(e.currentTarget.dataset.id)
      var that = this;
      // console.log(this)
      // console.log(this.data.result.student_id)
      var student_id = this.data.result.student_id;
      console.log(student_id);
      console.log("111");
      wx.cloud.callFunction({
        // 要调用的云函数名称
        name: 'update_student',
        // 传递给云函数的event参数
        data: {
         id:student_id,
         num:1
        }
      }).then(res => {
        console.log(res)
        that.triggerEvent('callSomeFun')
      })
      
    }
 ,
    refuseBtn(){
      var that = this;
      var student_id = this.data.result.student_id;
      wx.cloud.callFunction({
        // 要调用的云函数名称
        name: 'update_student',
        // 传递给云函数的event参数
        data: {
         id:student_id,
         num:2
        }
      }).then(res => {
        console.log(res)
        that.triggerEvent('callSomeFun')
      })
      

    }
  }
 
})
